const path = require("path");

module.exports = async ({ config, mode }) => {
  config.module.rules.push({
    test: /\.css$/,
    use: [
      {
        loader: "postcss-loader",
        options: {
          config: {
            path: path.resolve(__dirname, '../postcss.config.js')
          }
        }
      }
    ],
    include: path.resolve(__dirname, "../src")
  });

  config.module.rules[0].use[0].options.plugins = [
    require.resolve('babel-plugin-react-docgen'),
  ]

  return config;
};